package com.mitaotao._1_语法._4_循环.单循环._02_求和1到100;

public class _02_2_求和while {
    public static void main(String[] args) {
        int sum = 0;
        int num = 1;
        while(num <= 100){
            sum = sum+num;
            num++;
        }
        System.out.println("1-100的和为："+sum);

    }
}
